package cn.duapi.weblauncher;

/**
 * 
 * @author qinwei
 */
public class SpringWebApp {

    final static String DEFAULT_WEBAPP = "src/main/webapp/";

    final static String DEFAULT_EMBEDDED_SPRING_WEBXML = "cn/duapi/weblanucher/spring-web.xml";


    /**
     * start a spring web app by use default spring-xml embed
     * <P>
     * cn/duapi/weblanucher/spring-web.xml
     * 
     * @param port
     */
    public static void start(int port) {
        JettyServer.start(port, DEFAULT_WEBAPP, DEFAULT_EMBEDDED_SPRING_WEBXML, "/");
    }

    /**
     * start a spring web app by use default spring-xml embed
     * <P>
     * cn/duapi/weblanucher/spring-web.xml
     * 
     * @param port
     * @param contextPath
     */
    public static void start(int port, String contextPath) {
        JettyServer.start(port, DEFAULT_WEBAPP, DEFAULT_EMBEDDED_SPRING_WEBXML, contextPath);

    }
}
